// 引入axios
const axios = require("axios");

// 获取接口地址
axios.defaults.baseURL = "http://fitness.h5.itsource.cn:3701";

// 将token放入本地存储
let token = localStorage.getItem("token");
if (token) {
	axios.defaults.headers.common["Authorization"] = "baearer " + token;
}

// 暴露axios
module.exports = axios;
